<template>
	<view class="contina">
		<view class="box w">
			<view class="tips">
				推广类型
			</view>
			<view class="cont_item">
				<template v-for="(item,idx) in list">
					<view class="item" :class="idx == curre ? 'av_item' : ''" @click="changeIdx(item,idx)">
						<text :class="`iconfont ${item.icon}`" :style="{color:item.color}"></text>
						<text class="text">{{item.text}}</text>
					</view>
				</template>
			</view>
		</view>
		<template v-if="[0].includes(curre)"></template>
		<view class="box">
			<view class="tips w">
				基本设置
			</view>
			<view class="cont_item" style="background-color: #fff;">
				<u-cell-group :border="false" :titleStyle="{width:'230rpx'}">
					<u-cell title="跳转小程序">
						<template #icon>
							<view style="color:red">*</view>
						</template>
						<template #contnetVal>
							<view class="val">
								公共小程序
							</view>
						</template>
						<template #right-icon>
							<u-icon name="arrow-right"></u-icon>
						</template>
					</u-cell>
					<u-cell title="外链备注">
						<template #icon>
							<view style="color:red">*</view>
						</template>
						<template #contnetVal>
							<view class="val">
								<u--input placeholder="请输入外链备注(用于内部区分)" border="none" clearable></u--input>
							</view>
						</template>
					</u-cell>
					<u-cell title="外链名称">
						<template #icon>
							<view style="color:red">*</view>
						</template>
						<template #contnetVal>
							<view class="val">
								<u--input placeholder="请输入外链名称(展示页标题)" border="none" clearable></u--input>
							</view>
						</template>
					</u-cell>
				</u-cell-group>
			</view>
		</view>
		<view class="box">
			<view class="tips w">
				扫码页设置
			</view>
			<view class="cont_item" style="background-color: #fff;">
				<u-cell-group :border="false" :titleStyle="{width:'230rpx'}">
					<u-cell>
						<template #title>
							<view style="width: 400rpx;">
								上传二维码名片(可多项)
							</view>
						</template>
						<template #icon>
							<view style="color:red">*</view>
						</template>
						<template #right-icon>
							<u-button type="primary" style="height: 40rpx;" :plain="true" text="编辑"></u-button>
						</template>
					</u-cell>
					<u-cell>
						<template #contnetVal>
							<u-button type="primary" class="addPlus" icon="plus" :border="false"
								style="width:200rpx;height: 40rpx;border: none;" :plain="true" text="添加名片"></u-button>
						</template>
					</u-cell>
				</u-cell-group>
			</view>
		</view>
		<view class="box">
			<view class="tips w">
				切换规则设置
			</view>
			<view class="cont_item" style="background-color: #fff;">
				<u-cell-group :border="false" :titleStyle="{width:'230rpx'}">
					<u-cell title="">
						<template #icon>
							<u-radio name="xcx" :size="30">
							</u-radio>
						</template>
						<template #contnetVal>
							<view class="val">
								<view>顺序切换</view>
								<view style="font-size: 24rpx;color: #A3A3A3;">子项访问一次后切换下一项</view>
							</view>
						</template>
					</u-cell>
					<u-cell title="">
						<template #icon>
							<u-radio name="xcx" :size="30">
							</u-radio>
						</template>
						<template #contnetVal>
							<view class="val">
								<view>随机切换</view>
								<view style="font-size: 24rpx;color: #A3A3A3;">所有子项随机显示</view>
							</view>
						</template>
					</u-cell>
					<u-cell title="">
						<template #icon>
							<u-radio name="xcx" :size="30">
							</u-radio>
						</template>
						<template #contnetVal>
							<view class="val">
								<view>轮训切换</view>
								<view style="font-size: 24rpx;color: #A3A3A3;">子项访问次数达到切换频率后切换下一项</view>
							</view>
						</template>
					</u-cell>
					<u-cell title="">
						<template #contnetVal>
							<view class="val">
								<view>无限循环模式</view>
								<view class="swch">
									<view style="font-size: 24rpx;color: #A3A3A3;">开启后若每一项的访问量都达到了该子项设定的切换频率后开始新一轮循环
									</view>
									<u-switch v-model="swival" :size="30"></u-switch>
								</view>
							</view>
						</template>
					</u-cell>
					<u-cell title="">
						<template #contnetVal>
							<view class="val">
								<view>IP限制模式</view>
								<view class="swch">
									<view style="font-size: 24rpx;color: #A3A3A3;">开启后访问者IP被系统锁定，同一IP访问展示该IP第一次访问的名片
									</view>
									<u-switch v-model="swival" :size="30"></u-switch>
								</view>
							</view>
						</template>
					</u-cell>
				</u-cell-group>
			</view>
		</view>
		<view class="box">
			<view class="tips w">
				隐私设置
			</view>
			<view class="cont_item" style="background-color: #fff;">
				<u-cell-group :border="false" :titleStyle="{width:'230rpx'}">
					<u-cell title="">
						<template #contnetVal>
							<view class="val">
								<view>海报模式</view>
								<view class="swch">
									<view style="font-size: 24rpx;color: #A3A3A3;">开启后二维码将全屏展示<text
											style="color:red">(会员可用)</text></view>
									<u-switch v-model="swival" :size="30"></u-switch>
								</view>
							</view>
						</template>
					</u-cell>
					<u-cell title="底部提示">
						<template #contnetVal>
							<view class="val" style="color: #A3A3A3;">
								例：扫码添加客服，不填则显示
							</view>
						</template>
					</u-cell>
				</u-cell-group>
			</view>
		</view>
		<view class="info w">
			<view class="">
				<u-icon name="info-circle" size="30"></u-icon>
			</view>
			<view class="text">
				提示:新建的二维码名片有效期默认7天,切换频
				率200次,添加名片后请点击【编辑】按钮按需设
				置名片访问规则
			</view>
		</view>
		<view class="warning">
			<view class="tip">*提交前注意事项</view>
			<view class="c_i">
				1、禁止上传违法违规内容,禁止将本外链用于违法、违规月用途,并严格遵守《微信外链管理规范》
			</view>
			<view class="c_i">
				2、你将对外链合法性自担全责,并赔偿由此造成的损失。
			</view>
			<view class="c_i">
				3、所有外链都有专人审核,一经发现违规将直接删除外链、永永久封号,概不退款,并视情形提交给公安部门处理。
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				curre: 0,
				swival: true,
				list: [{
					icon: "icon-weixin-copy",
					text: "微信号",
					color: "#0BD200"
				}, {
					icon: "icon-qudao-_weixinqun",
					text: "微信群",
					color: "#3E00E5"
				}, {
					icon: "icon-gongzhonghao",
					text: "公众号",
					color: "#47BF2F"
				}, {
					icon: "icon-qiyehulian",
					text: "企业小程序",
					color: "#47BF2F"
				}, {
					icon: "icon-gerenxiaochengxu",
					text: "个人小程序",
					color: "#3E00E5"
				}, {
					icon: "icon-shipinhao",
					text: "视频号",
					color: "#DEA064"
				}, {
					icon: "icon-qiyehulian",
					text: "企业微信号",
					color: "#4D89B9"
				}]
			}
		},
		methods: {
			changeIdx(row, idx) {
				this.curre = idx;
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		margin-top: 30rpx;
		font-family:'Microsoft YaHei';

		.tips {
			color: #A2A2A2;
			font-size: 28rpx;
			margin-bottom: 20rpx;
		}

		.cont_item {
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;

			.item {
				width: 32%;
				height: 80rpx;
				background-color: #fff;
				border-radius: 12rpx;
				line-height: 37px;
				padding-left: 30rpx;
				box-sizing: border-box;
				margin-bottom: 10rpx;

				.text {
					font-size: 28rpx;
				}

				.iconfont {
					margin-right: 20rpx;
					font-size: 32rpx;
				}
			}

			::v-deep .u-cell__title-text {
				width: 170rpx;
			}

			.val {
				width: 100%;

				.swch {
					display: flex;
					justify-content: space-between;
				}
			}

			.addPlus::after {
				width: 0;
				height: 0;
			}
		}
	}

	.av_item {
		border: #3D7EFF solid 1px;
		box-sizing: border-box;
	}

	.info {
		display: flex;
		background-color: #FCF6EC;
		width: 90%;
		margin: 30rpx auto;
		align-items: center;
		padding: 40rpx;

		.text {
			color: red;
			margin-left: 30rpx;
			font-size: 32rpx;
		}
	}

	.warning {
		width: 90%;
		margin: 30rpx auto;

		.tip {
			color: red;
			font-size: 32rpx;
			margin-bottom: 30rpx;
		}

		.c_i {
			font-size: 28rpx;
			letter-spacing: 2px;
			margin-top: 10rpx;
			line-height: 2;
		}
	}
</style>
